ds_list_set(id, pos, val);
参数 | 描述 |
---|---|
id | 需要添加数据的列表索引值 |
pos | The position within the list to set. |
[val2, ... max_val] | The value to set in the list. |
返回: N/A(无返回值)
This function can be used to set a previously added list entry.
You give the list ID (as returned when you created the list) and
the position within the list to set as well as the value to set it
to. Note that if the entry being set is outside the bounds of the
list (ie, you set list entry 20 but the current list only contains
10 entries) then the list will be filled to the given position and
each entry will be set to 0. This function is the same as using the
DS list
accessor.
for (var i = 0; i < ds_list_size(list); i++;)
{
ds_list_set(list, i, -1);
}
以上代码向"sc_list"尾部添加了一个值,这个值是变量"score"中所存储的值。